<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();

if($_RQ['op']=='main'){
		
	$id = intval($_RQ['id']);
		if (empty($id)) 
		{
			
			$member = getMember($_SESSION['uid']);
		}
		else 
		{
			$member = getMember($id);
		}
		if (empty($member)) 
		{
			exi('未找到用户!', 'error', '/index/');
		}
		$condition = ' and f.uniacid = :uniacid and f.mid=:mid';
		$params = array(':uniacid' => $_SESSION['uniacid'], ':mid' => $member['mid']);
		$sql = 'select b.id,b.logo,b.title from ' . tablename('jy_sns_board_follow') . ' f ' . ' left join ' . tablename('jy_sns_board') . ' b on f.bid = b.id ' . '   where 1 and f.uniacid = :uniacid and f.mid=:mid ORDER BY f.createtime asc';
		$list = pdo_fetchall($sql,$params);
		//$total = pdo_fetchcolumn('select b.id,b.logo,b.title from ' . tablename('jy_sns_board_follow') . ' f ' . ' left join ' . tablename('jy_sns_board') . ' b on f.bid = b.id ' . ' where 1 ' . $condition, $params);
		foreach ($list as &$row ) 
		{
			$row['postcount'] = getPostCount($row['id']);
			$row['followcount'] = getFollowCount($row['id']);
			$row['logo'] = tomedia($row['logo']);
		}
		
		//$return['total'] = $total;
		$return['list'] = $list;
		$return['mid'] = $member['mid'];
		$return['mymid'] = $_SESSION['uid'];
		$return['member'] = $member;
		exi($return);
	}
?>